#include<string>
#include<iostream>

class Person {
	friend std::ostream& operator<<(std::ostream& os, Person& p);
public:
	int m_A;
	int m_B;
};

Person operator+(Person& p1, Person& p2) {
	Person temp;
	temp.m_A = p1.m_A + p2.m_A;
	temp.m_B = p1.m_B + p2.m_B;
	return temp;
}
Person operator+(Person& p1, int num) {
	Person temp;
	temp.m_A = p1.m_A + num;
	temp.m_B = p1.m_B + num;
	return temp;
}

std::ostream& operator<<(std::ostream& os, Person& p) {
	std::cout << p.m_A << std::endl;
	std::cout << p.m_B << std::endl;
	return std::cout;
}